<?php
/**
 * Created by PhpStorm.
 * User: zxy
 * Date: 2018/2/28
 * Time: 10:18
 */

require_once __DIR__. "/../dao/CodeDao.php";
class ScanController
{
    function action($code_id){
        $this->isBind($code_id);
    }
    function isBind($codeId){
        if(!empty($codeId)){
                $codeDao = new CodeDao();
                if($codeDao->isExistUser($codeId)==0){
                    header("location: ../view/binding.html?codeId=".$codeId);
               }else{
                   $userInfo =  $codeDao->selectUserInfoByCodeId($codeId);
//                    header("location: ../view/main.html?id=".$userInfo[0]["user_id"]);
                    header("location: ../view/userInfo.html?id=".$userInfo[0]["user_id"]);
               }
        }else{
            echo "非法请求！";
        }
    }
}
$a  = new ScanController();
/*//调用查看结1果
echo $a->scerweima('http://10.216.60.182/maxun/scan.php/?n='.uniqid());*/
$a->isBind($_GET["n"]);
